#pragma once
#ifdef _WINDOWS  //64位系统没有预定义 WIN32
#ifdef __cplusplus
#define DLL_EXPORT_C_DECL extern "C" __declspec(dllexport)
#else
#define DLL_EXPORT_DECL __declspec(dllexport)
#endif
#else
#ifdef __cplusplus
#define DLL_EXPORT_C_DECL extern "C"
#else
#define DLL_EXPORT_DECL extern
#endif
#endif

#ifdef _WINDOWS
#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
#include "stddef.h"
#ifdef WIN32
#define WINAPI      __cdecl
#include "../include/HSTradeApi.h"
#pragma comment(lib, "../include/HSMdApi.lib")
#else
#define WINAPI      __stdcall
#include "../include/HSTradeApi.h"
#pragma comment(lib, "../include/HSMdApi.lib")
#endif
#else
#define WINAPI
#include "../include/HSTradeApi.h"
#endif

#include <string.h>

class Trade: CHSTradeSpi
{
public:
    Trade(void);
    [[ range . ]]
	// [[ .Comment ]]
	typedef void (WINAPI *[[ .FuncTypeName ]])(void*[[ range $i, $v := .FuncFields ]], [[ .FieldType ]] [[ .FieldName ]][[ end ]]);
	void *_[[ .FuncName ]];
	virtual void On[[ .FuncName ]]([[ range $n, $var := .FuncFields ]][[if gt $n 0]], [[end]][[ .FieldType ]] [[ .FieldName ]][[ end ]]){if (_[[ .FuncName ]]) (([[ .FuncTypeName ]])_[[ .FuncName ]])(this[[ range $n, $var := .FuncFields ]], [[ trimStar .FieldName ]][[ end ]]);}
    [[ end ]]
};
